
module WindowPerformedHaircutDetails (windowPerformedHaircutDetails) where

import Graphics.UI.Gtk
import PerformedHaircut
import Haircut

windowPerformedHaircutDetails :: IO PerformedHaircut -> IO ()
windowPerformedHaircutDetails performedHc = do

    pHaircut <- performedHc
    --let pHaircut = createPerformedHaircut (createHaircut "Color" "hace colorrr") ("Todo salio bien")
    initGUI
    window <- windowNew
    windowSetPosition window WinPosCenter
    windowSetTitle window "Detalles de corte"
    
    buttonBack <- buttonNewWithLabel "Volver"
    buttonBack `onClicked` (widgetDestroy window)
    
    sep1 <- vSeparatorNew
    sep2 <- hSeparatorNew
    
    labelName <- labelNew (Just "Nombre:")
    labelHcName <- labelNew (Just (getHaircutName (hisKindOfHaircut pHaircut)))
    labelDescripcion <- labelNew (Just "Descripcion:")
    labelHcDescripcion <- labelNew (Just (getHaircutDesc (hisKindOfHaircut pHaircut)))
    labelName <- labelNew (Just "Nombre:") 
    labelHcNotes <- labelNew (Just (hisSpecificNotes pHaircut))
    labelNotes <- labelNew (Just "Notas:")
    
    mainvbox <- vBoxNew False 5
    
    vboxName <- vBoxNew False 5
    vboxDecription <- vBoxNew False 5
    
    hboxHaircut <- hBoxNew True 5
    
    boxPackStart vboxName labelName  PackNatural 1
    boxPackStart vboxName labelHcName  PackNatural 1
    
    boxPackStart vboxDecription labelDescripcion  PackNatural 1
    boxPackStart vboxDecription labelHcDescripcion  PackNatural 1
    
    boxPackStart hboxHaircut vboxName  PackNatural 1
    boxPackStart hboxHaircut sep1  PackNatural 1
    boxPackStart hboxHaircut vboxDecription  PackNatural 1
    
    boxPackStart mainvbox hboxHaircut  PackNatural 1
    boxPackStart mainvbox sep2  PackNatural 1
    boxPackStart mainvbox labelDescripcion  PackNatural 1
    boxPackStart mainvbox labelNotes  PackNatural 1
    boxPackStart mainvbox labelHcNotes  PackNatural 1
    boxPackStart mainvbox buttonBack  PackNatural 1
    
    set window [windowDefaultWidth := 200, windowDefaultHeight := 150,
              containerBorderWidth := 10, containerChild := mainvbox]
              
    widgetShowAll window
    mainGUI
    
    
    
    
    